package com.shqcjd.preinstallmobile.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.preinstallmobile.R;
import com.shqcjd.preinstallmobile.model.pojo.RouteInfoListBean;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class RouteAdapter extends BaseQuickAdapter<RouteInfoListBean.ItemsBean,RouteAdapter.ViewHolder> {

    public RouteAdapter(@Nullable List<RouteInfoListBean.ItemsBean> data) {
        super(R.layout.item_route, data);
    }

    @Override
    protected void convert(RouteAdapter.ViewHolder helper, RouteInfoListBean.ItemsBean item) {
        helper.itemRouteName.setText((helper.getAdapterPosition()+1)+". "+item.name);
        helper.itemroutekks.setText("kks:"+item.kks);
        helper.itemrouteTime.setText(item.record_time);
    }

    class ViewHolder extends BaseViewHolder {
        @BindView(R.id.item_route_name)
        TextView itemRouteName;
        @BindView(R.id.item_route_kks)
        TextView itemroutekks;
        @BindView(R.id.item_route_time)
        TextView itemrouteTime;

        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }

}
